import { USDT_TOKEN, Erc20ABI, Node_CONTRACT } from './index'

export const BalanceOf = async (userAddr) => {
    return tronWeb
        .contract(Erc20ABI, USDT_TOKEN)
        .balanceOf(userAddr)
        .call()
}

export const Allowance = async (userAddr) => {
    return tronWeb
        .contract(Erc20ABI, USDT_TOKEN)
        .allowance(userAddr, Node_CONTRACT)
        .call()
}

export const Approve = async (address, amount) => {
    return tronWeb
        .contract(Erc20ABI, USDT_TOKEN)
        .approve(Node_CONTRACT, amount)
        .send()
}




